﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Kmust.Commom;

namespace Kmust.Commom
{
   public static class AuthorRouter
    {
       private const string wrongmsg = "系统异常，请联系管理员！";
       public static bool IsAuthor(string code)
       {
           try
           {
               bool result = Commom.KmustDate.autdev.Where(row => row.Code.Equals(code)).Count()>0;
               if(result)
               {
                     return true;
               }
               else
               {
                   return false;
               }
              
           }
           catch
           {
               return false;
           }
       } 
 
       public static int GetAuthorType(string code)
       {
           try
           {
               int result =Convert.ToInt32(Commom.KmustDate.auttar.Select(row => row.AuthType).Where(row => row.Equals(code)).ToString());
               return result;
           }
           catch(Exception e)
           {
               return -1;
           }
       }
    }
}
